package com.cgbl.cg.adapter

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.cgbl.cg.R
import com.robot.base.configs.PrefsManager
import com.robot.base.model.ResourceBean
import com.robot.base.utils.pic.ImageLoaderUtils

class ResourceAdapter : BaseQuickAdapter<ResourceBean, BaseViewHolder>(R.layout.app_item_resource) {

    override fun convert(holder: BaseViewHolder, item: ResourceBean) {
        holder.setText(R.id.item_tv_name, item.name)
            .setText(R.id.tv_desc, PrefsManager.getUserInfo().nickName)
            .setText(R.id.tv_resource_type, item.resourceFormat)

        ImageLoaderUtils.displayRound(context, holder.getView(R.id.iv_resource_img), item.coverUrl, 4)

    }
}